package face.pay.util.page;

/**
 * @Auther: zkj
 * @Date: 2018/11/19 17:57
 * @Description:
 */
public class PageParam {

    private Integer pageSize=50;

    private Integer pageNo=0;

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getPageNo() {
        if(pageNo==null || new Integer(0).equals(pageNo)){
           return 0;
        }
        return pageNo;
    }


    public Integer getStart(){
        if(pageNo == null || pageNo == 0){ pageNo = 1; }
        if(pageSize == null || pageSize == 0){ pageSize = 50; }
        return   (pageNo-1) * pageSize ;
    }

    public Integer getLength(){
        if(pageSize == null || pageSize == 0){ pageSize = 50; }
        return  pageSize;
    }

    public void setPageNo(Integer pageNo) {
        this.pageNo = pageNo;
    }
}
